USE [NANS21V]
GO

/****** Object:  StoredProcedure [dbo].[Rekidai]    Script Date: 05/19/2014 13:43:55 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Rekidai]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[Rekidai]
GO

CREATE PROCEDURE [dbo].[Rekidai]
	@TAIKAINO int,
	@KYOGINO int,
	@SABUNO int
AS
SELECT 
	C.COMMENTNO, 
	C.PRINTNO, 
	C.COMMENTRYAKU, 
	R.REKIDAINO, 
	R.KIROKU, 
	R.SENSYUMEI, 
	R.HIDUKE, 
	R.SOKUTEI, 
	C.COMMENTMEI 
FROM 
	TBL_REKIDAI AS R, 
	TBL_COMMENT AS C 
WHERE 
	R.TAIKAINO = @TAIKAINO 
	AND R.KYOGINO = @KYOGINO 
	AND R.SABUNO = @SABUNO 
	AND R.COMMENTNO = C.COMMENTNO
